<template>
  <div class="nav">
    <a-row class="top">
      <a-col :span="2"></a-col>
      <a-col :span="20"><div class="namelist">
      <div class="namelist-inner">
        <div class="namelist-inner-top">
          <!-- <span class="span" @click="backTo">
            <img src="../../assets/images/fan hui.png" class="img" />
            &nbsp;&nbsp;收藏
          </span> -->
          <!-- <span class="namelist-collection span" style="color: #38C3C8;">
            <img src="../../assets/images/shou cang.png" class="img" alt />&nbsp;&nbsp;收藏
          </span> -->
          <span class="namelist-collection span" style="color: #38C3C8;width: 100px;" @click="openAll">
            <img src="../../assets/images/shou cang.png" class="img" alt />&nbsp;&nbsp;{{ openShowText }}
          </span>
        </div>
        <p>{{searchdetail.dis_name}}</p>
      </div>
    </div>
    <div class="namelist-inner-inner">
      <el-collapse v-model="activeNames" @change="handleChange" class="namelist-inner-inner-top">
        <el-row class="row" id="div0">
          <el-col :span="1" style="padding-top: 10px;">
            <p>概况</p>
          </el-col>
          <el-col :span="23" style="padding-left: 65px;padding-top: 0px;">
            <el-collapse-item name="1" class="inner-datail">
              <el-row>
                <el-col :span="1">
                  <p>参</p>
                </el-col>
                <el-col :span="23">
                  <div>{{searchdetail.gen_sit}}</div>
                </el-col>
              </el-row>
            </el-collapse-item>
          </el-col>
        </el-row>
        <el-row class="row" id="div1">
          <el-col :span="2" style="padding-top: 10px;">
            <p>临床表现</p>
          </el-col>
          <el-col :span="22">
            <el-collapse-item
              name="2"
              class="inner-datail"
              style="padding-left: 20px;padding-top: 0px;"
            >
              <el-row>
                <el-col :span="1">
                  <p>参</p>
                </el-col>
                <el-col :span="23">
                  <div>{{searchdetail.cli_man}}</div>
                </el-col>
              </el-row>
            </el-collapse-item>
          </el-col>
        </el-row>
        <el-row class="row" id="div2">
          <el-col :span="1" style="padding-top: 10px;">
            <p>病因</p>
          </el-col>
          <el-col :span="23" style="padding-left: 65px;padding-top: 0px;">
            <el-collapse-item name="3" class="inner-datail">
              <el-row>
                <el-col :span="1">
                  <p>参</p>
                </el-col>
                <el-col :span="23">
                  <div>{{searchdetail.cau_dis}}</div>
                </el-col>
              </el-row>
            </el-collapse-item>
          </el-col>
        </el-row>
        <el-row class="row" id="div3">
          <el-col :span="1" style="padding-top: 10px;">
            <p>检查</p>
          </el-col>
          <el-col :span="23">
            <el-collapse-item
              name="4"
              class="inner-datail"
              style="padding-left: 65px;padding-top: 0px;"
            >
              <el-row>
                <el-col :span="1">
                  <p>参</p>
                </el-col>
                <el-col :span="23">
                  <div>{{searchdetail.check_up}}</div>
                </el-col>
              </el-row>
            </el-collapse-item>
          </el-col>
        </el-row>
        <el-row class="row">
          <el-col :span="1" style="padding-top: 10px;">
            <p>诊断</p>
          </el-col>
          <el-col :span="23">
            <el-collapse-item
              name="5"
              class="inner-datail"
              style="padding-left: 65px;padding-top: 0px;"
            >
              <el-row>
                <el-col :span="1">
                  <p>参</p>
                </el-col>
                <el-col :span="23">
                  <div>{{searchdetail.diagonse}}</div>
                </el-col>
              </el-row>
            </el-collapse-item>
          </el-col>
        </el-row>
        <el-row class="row">
          <el-col :span="1" style="padding-top: 10px;">
            <p>治疗</p>
          </el-col>
          <el-col :span="23">
            <el-collapse-item
              name="7"
              class="inner-datail"
              style="padding-left: 65px;padding-top: 0px;"
            >
              <el-row>
                <el-col :span="1">
                  <p>参</p>
                </el-col>
                <el-col :span="23">
                  <div>{{searchdetail.treat}}</div>
                </el-col>
              </el-row>
            </el-collapse-item>
          </el-col>
        </el-row>
      </el-collapse>
    </div></a-col>
      <a-col :span="2"></a-col>
    </a-row>
    
    <div class="container">
      <div class="nav" :class="[isSelected]">
        <span class="navon5"></span>
        <p class="navon4"></p>
        <li>
          <p href class="navon0"></p>
          <p href class="navon0-1"></p>
          <a id="navon0" href="#div0" @click="navClick">概况</a>
        </li>
        <li>
          <p href class="navon1"></p>
          <p href class="navon1-1"></p>
          <a id="navon1" href="#div1" @click="navClick">临床表现</a>
        </li>
        <li>
          <p href class="navon2"></p>
          <p href class="navon2-1"></p>
          <a id="navon2" href="#div2" @click="navClick">病因</a>
        </li>
        <li>
          <p href class="navon3"></p>
          <p href class="navon3-1"></p>
          <a id="navon3" href="#div3" @click="navClick">检查</a>
        </li>
      </div>
    </div>
  </div>
</template>

<script>
  import GlobalLayout from '@/components/page/GlobalLayout'
  import Contextmenu from '@/components/menu/Contextmenu'
  import CompanyProfile from '../../components/knowlage/companyProfile'
  import { JeecgListMixin } from '@/mixins/zkxhKnowledge'
  import { getAction } from '@/api/manage'
  import 'swiper/dist/css/swiper.css'

  const indexKey = '/dashboard/analysis'

  export default {
    //这是主页
    name: 'KnowlageDetail',
    components: {
      GlobalLayout,
      Contextmenu,
      CompanyProfile,
    },
    mixins: [JeecgListMixin],
    data() {
      return {
        activeNames: ['1'],
        isSelected: '',
        searchdetail: [],
        url: {
          searchDetail: '/es/searchFull/getSearchSecondLeveList'
        },
        isOpenAll: false,//记录是否所有的都处于打开/关闭状态
        openShowText: "全部展开",//记录按钮文字
        activePage: '',
        text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`,
        
        url: {
          list: '/knowledge/knoCgOwner/getDepAll',
          listseach: '/knowledge/knoCgOwner/list',
          fuzzysearch: '/es/searchFull/getSearchDiseaseOrDrugsAll',
          getSearchSecondLeveList: '/es/searchFull/getSearchSecondLeveList',
          searchDetail: '/es/searchFull/getSearchSecondLeveList'
        },
        type: 0,
      }
    },
    created() {
      this.type = this.$route.query.type;
      
    },
    methods: {
      backTo(){
        this.$router.go(-1);
        localStorage.setItem("currentPage",this.type);
      },
      openAll(){
        if(this.isOpenAll){
          this.activeNames = [];
          this.openShowText = "全部展开";
        }else{
          this.openShowText = "全部关闭";
          this.activeNames = ['1','2','3','4','5'];
        }
        this.isOpenAll = !this.isOpenAll;
      },
      navClick(e) {
        var scrollBox1 = document.querySelector('.container')
        scrollBox1.scrollTo(0, [...e.target.id].pop() * 500)
        this.isSelected = e.target.id + '-selected'
        console.log(e.target.id)
        document.querySelector('#navon0').style.color = '#ccc'
        document.querySelector('#navon1').style.color = '#ccc'
        document.querySelector('#navon2').style.color = '#ccc'
        document.querySelector('#navon3').style.color = '#ccc'
        document.querySelector('.navon0').style.backgroundColor = '#ccc'
        document.querySelector('.navon1').style.backgroundColor = '#ccc'
        document.querySelector('.navon2').style.backgroundColor = '#ccc'
        document.querySelector('.navon3').style.backgroundColor = '#ccc'
        document.querySelector('.' + e.target.id).style.backgroundColor = '#38c3c8'
        document.querySelector('#' + e.target.id).style.color = '#38c3c8'
      },
      
      //update-end-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title
    }
  }
</script>

<style lang="scss" scoped>
/*
 * The following styles are auto-applied to elements with
 * transition="page-transition" when their visibility is toggled
 * by Vue.js.
 *
 * You can easily play with the page transition by editing
 * these styles.
 */

/*美化弹出Tab样式*/
.ant-tabs-nav-container {
  margin-top: 4px;
}

/* 修改 ant-tabs 样式 */
.tab-layout-tabs.ant-tabs {
  border-bottom: 1px solid #ccc;
  border-left: 1px solid #ccc;
  background-color: white;
  padding: 0 20px;

  .ant-tabs-bar {
    margin: 4px 0 0;
    border: none;
  }
}

.ant-tabs {
  &.ant-tabs-card .ant-tabs-tab {
    padding: 0 24px !important;
    background-color: white !important;
    margin-right: 10px !important;

    .ant-tabs-close-x {
      width: 12px !important;
      height: 12px !important;
      opacity: 0 !important;
      cursor: pointer !important;
      font-size: 12px !important;
      margin: 0 !important;
      position: absolute;
      top: 36%;
      right: 6px;
    }

    &:hover .ant-tabs-close-x {
      opacity: 1 !important;
    }
  }
}

.ant-tabs.ant-tabs-card > .ant-tabs-bar {
  .ant-tabs-tab {
    border: none !important;
    border-bottom: 1px solid transparent !important;
  }
  .ant-tabs-tab-active {
    border-color: #13c2c2 !important;
  }
}
.top{
  background-color: #f8f8f8;
  .namelist {
  width: 74%;

  div {
    border: none;
    background-color: #fff;
    width: 1100px;
  }

  .namelist-inner {
    width: 1124px;
    border: 1px #ebeef5 solid;
    border-bottom: none;
    background-color: #fff;
    height: 100%;

    .namelist-inner-top {
      float: left;
      height: 100%;
      width: 100%;

      .span {
        width: 76px;
        height: 32px;
        border: 1px #c9eff1 solid;
        background-color: #ebf9fa;
        text-align: center;
        line-height: 32px;
        border-radius: 4px;
        margin-left: 0px;
        float: left;
        margin-left: 32px;
        margin-top: 24px;
      }
      .namelist-collection {
        float: right;
        margin-right: 32px;

        .img {
          margin-top: -3px;
        }
      }
    }

    p {
      margin-top: 14px;
      font-size: 24px;
      color: #333333;
      float: left;
      margin-left: 32px;
      margin-top: 18px;
      padding-bottom: 10px;
    }
  }
}
.namelist-inner-inner {
  width: 74%;
  background-color: #fff;
  margin-left: 12px;
  padding-left: 32px;
  margin-top: -40px;
  padding-bottom: 20px;

  .namelist-inner-inner-top {
    border: 1px #ebeef5 solid;
    width: 1124px;
    padding-left: 32px;
    margin: 0px;
    background-color: #fff;

    p {
      font-size: 18px;
      color: #333;
    }

    .inner-datail {
      margin-top: 0px;
      p {
        font-size: 14px;
        width: 16px;
        height: 16px;
        background-color: #38c3c8;
        line-height: 16px;
        text-align: center;
        margin-top: 6px;
        border-radius: 2px;
        color: #fff;
      }
      span {
        color: #666;
      }
    }
  }
}
}
.el-icon-arrow-right:before {
  content: '\E6E0';
}
.el-icon-arrow-right.is-active:before {
  content: '\E6E0';
}
.container {
  position: absolute;
  top: 100px;
  right: 400px;
  display: flex;
  height: 120px;
  background-color: #fff;

  .nav {
    position: fixed;
    z-index: 5;
    display: inline-flex;
    flex-wrap: wrap;
    width: 100px;
    height: inherit;

    .navon4 {
      width: 8px;
      height: 8px;
      background-color: #fff;
      border-radius: 4px;
      border: 2px #ccc solid;
      position: relative;
      top: 5px;
      left: -5px;
    }

    li {
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      left: 0;
      width: 100%;
      .navon0-1 {
        height: 10px;
        width: 2px;
        background-color: #ccc;
        position: relative;
        top: -8px;
        left: -40px;
      }
      .navon1-1 {
        height: 10px;
        width: 2px;
        background-color: #ccc;
        position: relative;
        top: -10px;
        left: -26px;
      }
      .navon2-1 {
        height: 10px;
        width: 2px;
        background-color: #ccc;
        position: relative;
        top: -8px;
        left: -40px;
      }
      .navon3-1 {
        height: 10px;
        width: 2px;
        background-color: #ccc;
        position: relative;
        top: -10px;
        left: -40px;
      }

      .navon0 {
        width: 6px;
        height: 6px;
        background-color: #ccc;
        border-radius: 50%;
        position: relative;
        top: 5px;
        left: -36px;
      }

      .navon1 {
        width: 6px;
        height: 6px;
        background-color: #ccc;
        border-radius: 50%;
        position: relative;
        top: 5px;
        left: -22px;
      }
      .navon2 {
        width: 6px;
        height: 6px;
        background-color: #ccc;
        border-radius: 50%;
        position: relative;
        top: 5px;
        left: -36px;
      }
      .navon3 {
        width: 6px;
        height: 6px;
        background-color: #ccc;
        border-radius: 50%;
        position: relative;
        top: 5px;
        left: -36px;
      }

      a {
        font-size: 14px;
        left: 0px;
        cursor: pointer;
        color: #ccc;
        padding: 0px;
        display: inline;
      }
      a:hover {
        color: #38c3c8;
      }
    }
  }
}
.nav{
  height: 100%;
  background-color: #f8f8f8;
}
</style>